<?php
require_once dirname(__FILE__)."/../init.php";

$smsId = $_POST['smsId'];
$sourcePage = $_POST['sourcePage'];
ServiceFactory::getSMSService()->deleteById($smsId);

if ($sourcePage == "sent") {
?>
    <fb:redirect url="index.php?_page=sent&operation=delete&success=true" />
<?php
} else if ($sourcePage == "drafts") {
?>
    <fb:redirect url="index.php?_page=drafts&operation=delete&success=true" />
<?php
}

?>
